package com.xnewtech.xplatform.swan.system.api;

import com.xnewtech.xplatform.swan.model.resource.ResourceDefinition;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 资源服务api
 *
 * @author xnew
 * @Date 2020/12/12 20:54
 */
@RequestMapping("/resourceServiceApi")
public interface ResourceServiceApi {

    /**
     * 保存新增资源
     *
     * @author xnew
     * @Date 2020/12/12 20:54
     */
    @RequestMapping(name = "保存新增资源", value = "/saveResource", method = RequestMethod.POST)
    void saveResource(@RequestBody ResourceDefinition resourceDefinition);

    /**
     * 修改资源
     *
     * @author xnew
     * @Date 2020/12/12 20:54
     */
    @RequestMapping(name = "修改资源", value = "/editResource", method = RequestMethod.POST)
    void editResource(@RequestBody ResourceDefinition resourceDefinition);

    /**
     * 删除资源
     *
     * @author xnew
     * @Date 2020/12/12 20:54
     */
    @RequestMapping(name = "删除资源", value = "/removeResource", method = RequestMethod.GET)
    void removeResource(@RequestParam String resourceId);

    /**
     * 获取应用下拉列表
     *
     * @author xnew
     * @Date 2020/12/12 20:54
     */
    @RequestMapping(name = "获取应用下拉列表", value = "/getAppSelect", method = RequestMethod.GET)
    List<Map<String, Object>> getAppSelect();

    /**
     * 获取资源所属模块下拉列表
     *
     * @author xnew
     * @Date 2020/12/12 20:54
     */
    @RequestMapping(name = "获取资源所属模块下拉列表", value = "/getResModuleSelect", method = RequestMethod.GET)
    List<Map<String, Object>> getResModuleSelect();
}
